﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Threading;
using MultilingualInSpaInMvc.Models;
using System.IO;

namespace MultilingualInSpaInMvc
{
    public class HomeController : BaseController
    {
        public ActionResult Index()
        {
            ViewBag.Message = Resources.UI.Welcome;
            return View();
        }

        public ActionResult About()
        {
            
            return View();
        }

        public ActionResult Knockout()
        {
            Person p;
            if (Session["LanguageState"] != null)
            {
                p = Session["LanguageState"] as Person;
            }
            else
            {
                p = new Person { FirstName = "Sanjay", LastName = "Singh" };
            }
            return View(p);
        }

        public ActionResult ChangeLanguage(Person person)
        {
            if (person != null)
            {
                Session["LanguageState"] = person;
            }
           
            return null;
        }
    }
}
